<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
  <meta charset="utf-8" /><meta name="generator" content="Docutils 0.18.1: http://docutils.sourceforge.net/" />

  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  
<!-- OneTrust Cookies Consent Notice start for xilinx.github.io -->

<script src="https://cdn.cookielaw.org/scripttemplates/otSDKStub.js" data-document-language="true" type="text/javascript" charset="UTF-8" data-domain-script="03af8d57-0a04-47a6-8f10-322fa00d8fc7" ></script>
<script type="text/javascript">
function OptanonWrapper() { }
</script>
<!-- OneTrust Cookies Consent Notice end for xilinx.github.io -->
<!-- Google Tag Manager -->
<script type="text/plain" class="optanon-category-C0002">(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-5RHQV7');</script>
<!-- End Google Tag Manager -->
  <title>Class vart::TensorBufferExt &mdash; Vitis™ AI 3.5 documentation</title>
      <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
      <link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
      <link rel="stylesheet" href="../../../_static/_static/custom.css" type="text/css" />
  <!--[if lt IE 9]>
    <script src="../../../_static/js/html5shiv.min.js"></script>
  <![endif]-->
  
        <script data-url_root="../../../" id="documentation_options" src="../../../_static/documentation_options.js"></script>
        <script src="../../../_static/jquery.js"></script>
        <script src="../../../_static/underscore.js"></script>
        <script src="../../../_static/_sphinx_javascript_frameworks_compat.js"></script>
        <script src="../../../_static/doctools.js"></script>
    <script src="../../../_static/js/theme.js"></script>
    <link rel="index" title="Index" href="../../../genindex.html" />
    <link rel="search" title="Search" href="../../../search.html" />
    <link rel="next" title="Python APIs" href="../pythonlist.html" />
    <link rel="prev" title="Class vart::TensorBuffer" href="classvart_1_1_tensor_buffer.html" /> 
</head>

<body class="wy-body-for-nav">

<!-- Google Tag Manager -->
<noscript><iframe src="//www.googletagmanager.com/ns.html?id=GTM-5RHQV7" height="0" width="0" style="display:none;visibility:hidden" class="optanon-category-C0002"></iframe></noscript>
<!-- End Google Tag Manager --> 
  <div class="wy-grid-for-nav">
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search">
            <a href="../../../index.html" class="icon icon-home"> Vitis™ AI
            <img src="../../../_static/xilinx-header-logo.svg" class="logo" alt="Logo"/>
          </a>
              <div class="version">
                3.5
              </div>
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../../../search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>
        </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
              <p class="caption" role="heading"><span class="caption-text">Setup and Install</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../docs/reference/release_notes.html">Release Notes</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../docs/reference/system_requirements.html">System Requirements</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../docs/install/install.html">Host Install Instructions</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Quick Start Guides</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../docs/quickstart/vek280.html">Versal™ AI Edge VEK280</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../docs/quickstart/v70.html">Alveo™ V70</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Workflow and Components</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../docs/workflow.html">Overview</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../docs/workflow-system-integration.html">DPU IP Details and System Integration</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../docs/workflow-model-zoo.html">Vitis™ AI Model Zoo</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../docs/workflow-model-development.html">Developing a Model for Vitis AI</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../docs/workflow-model-deployment.html">Deploying a Model with Vitis AI</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Runtime API Documentation</span></p>
<ul class="current">
<li class="toctree-l1 current"><a class="reference internal" href="../classlist.html">C++ API Class</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="classvart_1_1_base_runner.html">Class vart::BaseRunner</a></li>
<li class="toctree-l2"><a class="reference internal" href="classvart_1_1_runner.html">Class vart::Runner</a></li>
<li class="toctree-l2"><a class="reference internal" href="classvart_1_1_runner_ext.html">Class vart::RunnerExt</a></li>
<li class="toctree-l2"><a class="reference internal" href="classvart_1_1_tensor_buffer.html">Class vart::TensorBuffer</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="#">Class vart::TensorBufferExt</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../pythonlist.html">Python APIs</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Additional Information</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../docs/reference/release_documentation.html">Vitis™ AI User Guides &amp; IP Product Guides</a></li>
<li class="toctree-l1"><a class="reference external" href="https://github.com/Xilinx/Vitis-AI-Tutorials">Vitis™ AI Developer Tutorials</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../docs/workflow-third-party.html">Third-party Inference Stack Integration</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../docs/reference/version_compatibility.html">IP and Tools Compatibility</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../docs/reference/faq.html">Frequently Asked Questions</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../docs/install/branching_tagging_strategy.html">Branching and Tagging Strategy</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Resources and Support</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../docs/reference/additional_resources.html">Technical Support</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../docs/reference/additional_resources.html#id1">Additional Resources</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Related AMD Solutions</span></p>
<ul>
<li class="toctree-l1"><a class="reference external" href="https://github.com/Xilinx/DPU-PYNQ">DPU-PYNQ</a></li>
<li class="toctree-l1"><a class="reference external" href="https://xilinx.github.io/finn/">FINN &amp; Brevitas</a></li>
<li class="toctree-l1"><a class="reference external" href="https://xilinx.github.io/inference-server/">Inference Server</a></li>
<li class="toctree-l1"><a class="reference external" href="https://github.com/amd/UIF">Unified Inference Frontend</a></li>
<li class="toctree-l1"><a class="reference external" href="https://ryzenai.docs.amd.com/en/latest/">Ryzen™ AI Developer Guide ~July 29</a></li>
<li class="toctree-l1"><a class="reference external" href="https://onnxruntime.ai/docs/execution-providers/community-maintained/Vitis-AI-ExecutionProvider.html">Vitis™ AI ONNX Runtime Execution Provider</a></li>
<li class="toctree-l1"><a class="reference external" href="https://xilinx.github.io/VVAS/">Vitis™ Video Analytics SDK</a></li>
</ul>

        </div>
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu"  style="background: black" >
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="../../../index.html">Vitis™ AI</a>
      </nav>

      <div class="wy-nav-content">
        <div class="rst-content">
          <div role="navigation" aria-label="Page navigation">
  <ul class="wy-breadcrumbs">
      <li><a href="../../../index.html" class="icon icon-home"></a> &raquo;</li>
          <li><a href="../classlist.html">C++ API Class</a> &raquo;</li>
      <li>Class vart::TensorBufferExt</li>
      <li class="wy-breadcrumbs-aside">
            <a href="../../../_sources/doxygen/api/class/classvart_1_1_tensor_buffer_ext.rst.txt" rel="nofollow"> View page source</a>
      </li>
  </ul>
  <hr/>
</div>
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
             
  <section id="class-vart-tensorbufferext">
<h1>Class vart::TensorBufferExt<a class="headerlink" href="#class-vart-tensorbufferext" title="Permalink to this heading">¶</a></h1>
<dl class="cpp class">
<dt class="sig sig-object cpp" id="_CPPv4N4vart15TensorBufferExtE">
<span id="_CPPv3N4vart15TensorBufferExtE"></span><span id="_CPPv2N4vart15TensorBufferExtE"></span><span id="vart::TensorBufferExt"></span><span class="target" id="classvart_1_1_tensor_buffer_ext"></span><span class="k"><span class="pre">class</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">TensorBufferExt</span></span></span><span class="w"> </span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="k"><span class="pre">public</span></span><span class="w"> </span><a class="reference internal" href="classvart_1_1_tensor_buffer.html#_CPPv4N4vart12TensorBufferE" title="vart::TensorBuffer"><span class="n"><span class="pre">TensorBuffer</span></span></a><a class="headerlink" href="#_CPPv4N4vart15TensorBufferExtE" title="Permalink to this definition">¶</a><br /></dt>
<dd><div class="breathe-sectiondef docutils container">
<p class="breathe-sectiondef-title rubric" id="breathe-section-title-public-functions">Public Functions</p>
<dl class="cpp function">
<dt class="sig sig-object cpp" id="_CPPv4NK4vart15TensorBufferExt9to_stringEv">
<span id="_CPPv3NK4vart15TensorBufferExt9to_stringEv"></span><span id="_CPPv2NK4vart15TensorBufferExt9to_stringEv"></span><span id="vart::TensorBufferExt::to_stringC"></span><span class="target" id="classvart_1_1_tensor_buffer_1a5879f4dcf612d462baa1bdfcf2f5387f"></span><span class="k"><span class="pre">virtual</span></span><span class="w"> </span><span class="n"><span class="pre">std</span></span><span class="p"><span class="pre">::</span></span><span class="n"><span class="pre">string</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">to_string</span></span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><span class="w"> </span><span class="k"><span class="pre">const</span></span><a class="headerlink" href="#_CPPv4NK4vart15TensorBufferExt9to_stringEv" title="Permalink to this definition">¶</a><br /></dt>
<dd><p>for fancy log messages </p>
</dd></dl>

<dl class="cpp function">
<dt class="sig sig-object cpp" id="_CPPv4N4vart15TensorBufferExt4dataEKNSt6vectorINSt7int32_tEEE">
<span id="_CPPv3N4vart15TensorBufferExt4dataEKNSt6vectorINSt7int32_tEEE"></span><span id="_CPPv2N4vart15TensorBufferExt4dataEKNSt6vectorINSt7int32_tEEE"></span><span id="vart::TensorBufferExt::data__std::vector:std::int32_t:C"></span><span class="target" id="classvart_1_1_tensor_buffer_1a0267b7ff6fd5270bd293571626e9e777"></span><span class="k"><span class="pre">virtual</span></span><span class="w"> </span><span class="n"><span class="pre">std</span></span><span class="p"><span class="pre">::</span></span><span class="n"><span class="pre">pair</span></span><span class="p"><span class="pre">&lt;</span></span><span class="n"><span class="pre">std</span></span><span class="p"><span class="pre">::</span></span><span class="n"><span class="pre">uint64_t</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="n"><span class="pre">std</span></span><span class="p"><span class="pre">::</span></span><span class="n"><span class="pre">size_t</span></span><span class="p"><span class="pre">&gt;</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">data</span></span></span><span class="sig-paren">(</span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="n"><span class="pre">std</span></span><span class="p"><span class="pre">::</span></span><span class="n"><span class="pre">vector</span></span><span class="p"><span class="pre">&lt;</span></span><span class="n"><span class="pre">std</span></span><span class="p"><span class="pre">::</span></span><span class="n"><span class="pre">int32_t</span></span><span class="p"><span class="pre">&gt;</span></span><span class="w"> </span><span class="n sig-param"><span class="pre">idx</span></span><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="p"><span class="pre">{</span></span><span class="p"><span class="pre">}</span></span><span class="sig-paren">)</span><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="m"><span class="pre">0</span></span><a class="headerlink" href="#_CPPv4N4vart15TensorBufferExt4dataEKNSt6vectorINSt7int32_tEEE" title="Permalink to this definition">¶</a><br /></dt>
<dd><p>Get the data address of the index and the size of the data available for use. </p>
<p>
Sample code:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">vart</span><span class="p">::</span><span class="n">TensorBuffer</span><span class="o">*</span> <span class="n">tb</span><span class="p">;</span>
<span class="n">std</span><span class="p">::</span><span class="n">tie</span><span class="p">(</span><span class="n">data_addr</span><span class="p">,</span> <span class="n">tensor_size</span><span class="p">)</span> <span class="o">=</span> <span class="n">tb</span><span class="o">-&gt;</span><span class="n">data</span><span class="p">({</span><span class="mi">0</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="mi">0</span><span class="p">});</span>
</pre></div>
</div>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>idx</strong> – The index of the data to be accessed, its dimension same as the tensor shape. </p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>A pair of the data address of the index and the size of the data available for use in byte unit.</p>
</dd>
</dl>
</dd></dl>

<dl class="cpp function">
<dt class="sig sig-object cpp" id="_CPPv4NK4vart15TensorBufferExt12get_locationEv">
<span id="_CPPv3NK4vart15TensorBufferExt12get_locationEv"></span><span id="_CPPv2NK4vart15TensorBufferExt12get_locationEv"></span><span id="vart::TensorBufferExt::get_locationC"></span><span class="target" id="classvart_1_1_tensor_buffer_1ab76cae37dd5bd473d2e89d064e4c8b4f"></span><span class="k"><span class="pre">inline</span></span><span class="w"> </span><span class="k"><span class="pre">virtual</span></span><span class="w"> </span><a class="reference internal" href="../file/tensor__buffer_8hpp.html#_CPPv4N4vart15TensorBufferExt10location_tE" title="vart::TensorBufferExt::location_t"><span class="n"><span class="pre">location_t</span></span></a><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">get_location</span></span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><span class="w"> </span><span class="k"><span class="pre">const</span></span><a class="headerlink" href="#_CPPv4NK4vart15TensorBufferExt12get_locationEv" title="Permalink to this definition">¶</a><br /></dt>
<dd><p>Get where the tensor buffer located. </p>
<p>
Sample code: </p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">vart</span><span class="p">::</span><span class="n">TensorBuffer</span><span class="o">*</span> <span class="n">tb</span><span class="p">;</span>
<span class="n">switch</span> <span class="p">(</span><span class="n">tb</span><span class="o">-&gt;</span><span class="n">get_location</span><span class="p">())</span> <span class="p">{</span>
            <span class="k">case</span> <span class="n">vart</span><span class="p">::</span><span class="n">TensorBuffer</span><span class="p">::</span><span class="n">location_t</span><span class="p">::</span><span class="n">HOST_VIRT</span><span class="p">:</span>
                  <span class="o">//</span> <span class="n">do</span> <span class="n">nothing</span>
                  <span class="k">break</span><span class="p">;</span>
            <span class="k">case</span> <span class="n">vart</span><span class="p">::</span><span class="n">TensorBuffer</span><span class="p">::</span><span class="n">location_t</span><span class="p">::</span><span class="n">HOST_PHY</span><span class="p">:</span>
                  <span class="o">//</span> <span class="n">do</span> <span class="n">nothing</span>
                  <span class="k">break</span><span class="p">;</span>
           <span class="n">default</span><span class="p">:</span>
                  <span class="o">//</span> <span class="n">do</span> <span class="n">nothing</span>
                  <span class="k">break</span><span class="p">;</span>
      <span class="p">}</span>
</pre></div>
</div>
<dl class="field-list simple">
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>the tensor buffer location, a location_t enum type value: HOST_VIRT/HOST_PHY/DEVICE_*.</p>
</dd>
</dl>
</dd></dl>

<dl class="cpp function">
<dt class="sig sig-object cpp" id="_CPPv4N4vart15TensorBufferExt8data_phyEKNSt6vectorINSt7int32_tEEE">
<span id="_CPPv3N4vart15TensorBufferExt8data_phyEKNSt6vectorINSt7int32_tEEE"></span><span id="_CPPv2N4vart15TensorBufferExt8data_phyEKNSt6vectorINSt7int32_tEEE"></span><span id="vart::TensorBufferExt::data_phy__std::vector:std::int32_t:C"></span><span class="target" id="classvart_1_1_tensor_buffer_1ac3e8852bfa0c6889aa0db8cc3aaa4e7b"></span><span class="k"><span class="pre">inline</span></span><span class="w"> </span><span class="k"><span class="pre">virtual</span></span><span class="w"> </span><span class="n"><span class="pre">std</span></span><span class="p"><span class="pre">::</span></span><span class="n"><span class="pre">pair</span></span><span class="p"><span class="pre">&lt;</span></span><span class="n"><span class="pre">uint64_t</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="n"><span class="pre">size_t</span></span><span class="p"><span class="pre">&gt;</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">data_phy</span></span></span><span class="sig-paren">(</span><span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="n"><span class="pre">std</span></span><span class="p"><span class="pre">::</span></span><span class="n"><span class="pre">vector</span></span><span class="p"><span class="pre">&lt;</span></span><span class="n"><span class="pre">std</span></span><span class="p"><span class="pre">::</span></span><span class="n"><span class="pre">int32_t</span></span><span class="p"><span class="pre">&gt;</span></span><span class="w"> </span><span class="n sig-param"><span class="pre">idx</span></span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv4N4vart15TensorBufferExt8data_phyEKNSt6vectorINSt7int32_tEEE" title="Permalink to this definition">¶</a><br /></dt>
<dd><p>Get the data physical address of the index and the size of the data available for use. </p>
<p>
Sample code: </p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">vart</span><span class="p">::</span><span class="n">TensorBuffer</span><span class="o">*</span> <span class="n">tb</span><span class="p">;</span>
<span class="n">std</span><span class="p">::</span><span class="n">tie</span><span class="p">(</span><span class="n">phy_data</span><span class="p">,</span> <span class="n">phy_size</span><span class="p">)</span> <span class="o">=</span> <span class="n">tb</span><span class="o">-&gt;</span><span class="n">data_phy</span><span class="p">({</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">});</span>
</pre></div>
</div>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>idx</strong> – The index of the data to be accessed, its dimension same to the tensor shape. </p>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>A pair of the data physical address of the index and the size of the data available for use in byte unit.</p>
</dd>
</dl>
</dd></dl>

<dl class="cpp function">
<dt class="sig sig-object cpp" id="_CPPv4N4vart15TensorBufferExt13sync_for_readE8uint64_t6size_t">
<span id="_CPPv3N4vart15TensorBufferExt13sync_for_readE8uint64_t6size_t"></span><span id="_CPPv2N4vart15TensorBufferExt13sync_for_readE8uint64_t6size_t"></span><span id="vart::TensorBufferExt::sync_for_read__uint64_t.s"></span><span class="target" id="classvart_1_1_tensor_buffer_1a9057a559781ab9afc2a3d9b11ee2dc52"></span><span class="k"><span class="pre">inline</span></span><span class="w"> </span><span class="k"><span class="pre">virtual</span></span><span class="w"> </span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">sync_for_read</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="n sig-param"><span class="pre">offset</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n sig-param"><span class="pre">size</span></span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv4N4vart15TensorBufferExt13sync_for_readE8uint64_t6size_t" title="Permalink to this definition">¶</a><br /></dt>
<dd><p>Invalid cache for reading Before read, it is no-op in case <a class="reference internal" href="#classvart_1_1_tensor_buffer_1ab76cae37dd5bd473d2e89d064e4c8b4f"><span class="std std-ref">get_location()</span></a> returns DEVICE_ONLY or HOST_VIRT. </p>
<p>
Sample code: </p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="k">for</span> <span class="p">(</span><span class="n">auto</span><span class="o">&amp;</span> <span class="n">output</span> <span class="p">:</span> <span class="n">output_tensor_buffers</span><span class="p">)</span> <span class="p">{</span>
    <span class="n">output</span><span class="o">-&gt;</span><span class="n">sync_for_read</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">output</span><span class="o">-&gt;</span><span class="n">get_tensor</span><span class="p">()</span><span class="o">-&gt;</span><span class="n">get_data_size</span><span class="p">()</span> <span class="o">/</span>
                                <span class="n">output</span><span class="o">-&gt;</span><span class="n">get_tensor</span><span class="p">()</span><span class="o">-&gt;</span><span class="n">get_shape</span><span class="p">()[</span><span class="mi">0</span><span class="p">]);</span>
<span class="p">}</span>
</pre></div>
</div>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>offset</strong> – The start offset address. </p></li>
<li><p><strong>size</strong> – The data size. </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>void</p>
</dd>
</dl>
</dd></dl>

<dl class="cpp function">
<dt class="sig sig-object cpp" id="_CPPv4N4vart15TensorBufferExt14sync_for_writeE8uint64_t6size_t">
<span id="_CPPv3N4vart15TensorBufferExt14sync_for_writeE8uint64_t6size_t"></span><span id="_CPPv2N4vart15TensorBufferExt14sync_for_writeE8uint64_t6size_t"></span><span id="vart::TensorBufferExt::sync_for_write__uint64_t.s"></span><span class="target" id="classvart_1_1_tensor_buffer_1a7cf59f4ee46d7bd356af8a8d2f00ae80"></span><span class="k"><span class="pre">inline</span></span><span class="w"> </span><span class="k"><span class="pre">virtual</span></span><span class="w"> </span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">sync_for_write</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="n sig-param"><span class="pre">offset</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n sig-param"><span class="pre">size</span></span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv4N4vart15TensorBufferExt14sync_for_writeE8uint64_t6size_t" title="Permalink to this definition">¶</a><br /></dt>
<dd><p>Flush cache for writing after write, it is no-op in case <a class="reference internal" href="#classvart_1_1_tensor_buffer_1ab76cae37dd5bd473d2e89d064e4c8b4f"><span class="std std-ref">get_location()</span></a> returns DEVICE_ONLY or HOST_VIRT. </p>
<p>
Sample code: </p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="k">for</span> <span class="p">(</span><span class="n">auto</span><span class="o">&amp;</span> <span class="nb">input</span> <span class="p">:</span> <span class="n">input_tensor_buffers</span><span class="p">)</span> <span class="p">{</span>
    <span class="nb">input</span><span class="o">-&gt;</span><span class="n">sync_for_write</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="nb">input</span><span class="o">-&gt;</span><span class="n">get_tensor</span><span class="p">()</span><span class="o">-&gt;</span><span class="n">get_data_size</span><span class="p">()</span> <span class="o">/</span>
                              <span class="nb">input</span><span class="o">-&gt;</span><span class="n">get_tensor</span><span class="p">()</span><span class="o">-&gt;</span><span class="n">get_shape</span><span class="p">()[</span><span class="mi">0</span><span class="p">]);</span>
<span class="p">}</span>
</pre></div>
</div>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>offset</strong> – The start offset address. </p></li>
<li><p><strong>size</strong> – The data size. </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>void</p>
</dd>
</dl>
</dd></dl>

<dl class="cpp function">
<dt class="sig sig-object cpp" id="_CPPv4N4vart15TensorBufferExt14copy_from_hostE6size_tPKv6size_t6size_t">
<span id="_CPPv3N4vart15TensorBufferExt14copy_from_hostE6size_tPKv6size_t6size_t"></span><span id="_CPPv2N4vart15TensorBufferExt14copy_from_hostE6size_tPKv6size_t6size_t"></span><span id="vart::TensorBufferExt::copy_from_host__s.voidCP.s.s"></span><span class="target" id="classvart_1_1_tensor_buffer_1a781dbc662ce87afedf825aebf94eb2ba"></span><span class="k"><span class="pre">virtual</span></span><span class="w"> </span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">copy_from_host</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n sig-param"><span class="pre">batch_idx</span></span>, <span class="k"><span class="pre">const</span></span><span class="w"> </span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n sig-param"><span class="pre">buf</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n sig-param"><span class="pre">size</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n sig-param"><span class="pre">offset</span></span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv4N4vart15TensorBufferExt14copy_from_hostE6size_tPKv6size_t6size_t" title="Permalink to this definition">¶</a><br /></dt>
<dd><p>copy data from source buffer. </p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>batch_idx</strong> – the batch index. </p></li>
<li><p><strong>buf</strong> – source buffer start address. </p></li>
<li><p><strong>size</strong> – data size to be copied. </p></li>
<li><p><strong>offset</strong> – the start offset to be copied. </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>void </p>
</dd>
</dl>
</dd></dl>

<dl class="cpp function">
<dt class="sig sig-object cpp" id="_CPPv4N4vart15TensorBufferExt12copy_to_hostE6size_tPv6size_t6size_t">
<span id="_CPPv3N4vart15TensorBufferExt12copy_to_hostE6size_tPv6size_t6size_t"></span><span id="_CPPv2N4vart15TensorBufferExt12copy_to_hostE6size_tPv6size_t6size_t"></span><span id="vart::TensorBufferExt::copy_to_host__s.voidP.s.s"></span><span class="target" id="classvart_1_1_tensor_buffer_1a04f040c860de3c9f54f96e661aabef60"></span><span class="k"><span class="pre">virtual</span></span><span class="w"> </span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">copy_to_host</span></span></span><span class="sig-paren">(</span><span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n sig-param"><span class="pre">batch_idx</span></span>, <span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n sig-param"><span class="pre">buf</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n sig-param"><span class="pre">size</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n sig-param"><span class="pre">offset</span></span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv4N4vart15TensorBufferExt12copy_to_hostE6size_tPv6size_t6size_t" title="Permalink to this definition">¶</a><br /></dt>
<dd><p>copy data to destination buffer. </p>
<p>
Sample code: </p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">vart</span><span class="p">::</span><span class="n">TensorBuffer</span><span class="o">*</span> <span class="n">tb_from</span><span class="p">;</span>
<span class="n">vart</span><span class="p">::</span><span class="n">TensorBuffer</span><span class="o">*</span> <span class="n">tb_to</span><span class="p">;</span>
<span class="k">for</span> <span class="p">(</span><span class="n">auto</span> <span class="n">batch</span> <span class="o">=</span> <span class="mi">0</span><span class="n">u</span><span class="p">;</span> <span class="n">batch</span> <span class="o">&lt;</span> <span class="n">batch_size</span><span class="p">;</span> <span class="o">++</span><span class="n">batch</span><span class="p">)</span> <span class="p">{</span>
       <span class="n">std</span><span class="p">::</span><span class="n">tie</span><span class="p">(</span><span class="n">data</span><span class="p">,</span> <span class="n">tensor_size</span><span class="p">)</span> <span class="o">=</span> <span class="n">tb_to</span><span class="o">-&gt;</span><span class="n">data</span><span class="p">({(</span><span class="nb">int</span><span class="p">)</span><span class="n">batch</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">});</span>
    <span class="n">tb_from</span><span class="o">-&gt;</span><span class="n">copy_to_host</span><span class="p">(</span><span class="n">batch</span><span class="p">,</span> <span class="n">reinterpret_cast</span><span class="o">&lt;</span><span class="n">void</span><span class="o">*&gt;</span><span class="p">(</span><span class="n">data</span><span class="p">),</span>
                        <span class="n">tensor_size</span><span class="p">,</span> <span class="mi">0</span><span class="n">u</span><span class="p">);</span>
<span class="p">}</span>
</pre></div>
</div>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>batch_idx</strong> – the batch index. </p></li>
<li><p><strong>buf</strong> – destination buffer start address. </p></li>
<li><p><strong>size</strong> – data size to be copied. </p></li>
<li><p><strong>offset</strong> – the start offset to be copied. </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>void</p>
</dd>
</dl>
</dd></dl>

<dl class="cpp function">
<dt class="sig sig-object cpp" id="_CPPv4NK4vart15TensorBufferExt10get_tensorEv">
<span id="_CPPv3NK4vart15TensorBufferExt10get_tensorEv"></span><span id="_CPPv2NK4vart15TensorBufferExt10get_tensorEv"></span><span id="vart::TensorBufferExt::get_tensorC"></span><span class="target" id="classvart_1_1_tensor_buffer_1a3c53b20e0e7b58a4c5d18baa10a3f0b6"></span><span class="k"><span class="pre">const</span></span><span class="w"> </span><a class="reference internal" href="../file/runner_8hpp.html#_CPPv43xir" title="xir"><span class="n"><span class="pre">xir</span></span></a><span class="p"><span class="pre">::</span></span><span class="n"><span class="pre">Tensor</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="sig-name descname"><span class="n"><span class="pre">get_tensor</span></span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><span class="w"> </span><span class="k"><span class="pre">const</span></span><a class="headerlink" href="#_CPPv4NK4vart15TensorBufferExt10get_tensorEv" title="Permalink to this definition">¶</a><br /></dt>
<dd><p>Get tensor of <a class="reference internal" href="../namespace/namespacevart.html#classvart_1_1_tensor_buffer"><span class="std std-ref">TensorBuffer</span></a>. </p>
<dl class="field-list simple">
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>A pointer to the tensor. </p>
</dd>
</dl>
</dd></dl>

</div>
<div class="breathe-sectiondef docutils container">
<p class="breathe-sectiondef-title rubric" id="breathe-section-title-public-static-functions">Public Static Functions</p>
<dl class="cpp function">
<dt class="sig sig-object cpp" id="_CPPv4N4vart15TensorBufferExt9to_stringE10location_t">
<span id="_CPPv3N4vart15TensorBufferExt9to_stringE10location_t"></span><span id="_CPPv2N4vart15TensorBufferExt9to_stringE10location_t"></span><span id="vart::TensorBufferExt::to_string__location_t"></span><span class="target" id="classvart_1_1_tensor_buffer_1a245a56dd22db5aa7c9804aaa427fc123"></span><span class="k"><span class="pre">static</span></span><span class="w"> </span><span class="n"><span class="pre">std</span></span><span class="p"><span class="pre">::</span></span><span class="n"><span class="pre">string</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">to_string</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="../file/tensor__buffer_8hpp.html#_CPPv4N4vart15TensorBufferExt10location_tE" title="vart::TensorBufferExt::location_t"><span class="n"><span class="pre">location_t</span></span></a><span class="w"> </span><span class="n sig-param"><span class="pre">value</span></span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv4N4vart15TensorBufferExt9to_stringE10location_t" title="Permalink to this definition">¶</a><br /></dt>
<dd><p>for <a class="reference internal" href="../namespace/namespacevart.html#classvart_1_1_tensor_buffer"><span class="std std-ref">TensorBuffer</span></a> location message </p>
</dd></dl>

<dl class="cpp function">
<dt class="sig sig-object cpp" id="_CPPv4N4vart15TensorBufferExt18copy_tensor_bufferEPN4vart12TensorBufferEPN4vart12TensorBufferE">
<span id="_CPPv3N4vart15TensorBufferExt18copy_tensor_bufferEPN4vart12TensorBufferEPN4vart12TensorBufferE"></span><span id="_CPPv2N4vart15TensorBufferExt18copy_tensor_bufferEPN4vart12TensorBufferEPN4vart12TensorBufferE"></span><span id="vart::TensorBufferExt::copy_tensor_buffer__vart::TensorBufferP.vart::TensorBufferP"></span><span class="target" id="classvart_1_1_tensor_buffer_1a9d8516b7a6303b98e7aeebdb7cebeb55"></span><span class="k"><span class="pre">static</span></span><span class="w"> </span><span class="kt"><span class="pre">void</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">copy_tensor_buffer</span></span></span><span class="sig-paren">(</span><a class="reference internal" href="../file/runner_8hpp.html#_CPPv44vart" title="vart"><span class="n"><span class="pre">vart</span></span></a><span class="p"><span class="pre">::</span></span><a class="reference internal" href="classvart_1_1_tensor_buffer.html#_CPPv4N4vart12TensorBufferE" title="vart::TensorBuffer"><span class="n"><span class="pre">TensorBuffer</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n sig-param"><span class="pre">tb_from</span></span>, <a class="reference internal" href="../file/runner_8hpp.html#_CPPv44vart" title="vart"><span class="n"><span class="pre">vart</span></span></a><span class="p"><span class="pre">::</span></span><a class="reference internal" href="classvart_1_1_tensor_buffer.html#_CPPv4N4vart12TensorBufferE" title="vart::TensorBuffer"><span class="n"><span class="pre">TensorBuffer</span></span></a><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n sig-param"><span class="pre">tb_to</span></span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv4N4vart15TensorBufferExt18copy_tensor_bufferEPN4vart12TensorBufferEPN4vart12TensorBufferE" title="Permalink to this definition">¶</a><br /></dt>
<dd><p>copy <a class="reference internal" href="../namespace/namespacevart.html#classvart_1_1_tensor_buffer"><span class="std std-ref">TensorBuffer</span></a> from one to another. </p>
<p>
Sample code:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">vart</span><span class="p">::</span><span class="n">TensorBuffer</span><span class="o">*</span> <span class="n">tb_from</span><span class="p">;</span>
<span class="n">vart</span><span class="p">::</span><span class="n">TensorBuffer</span><span class="o">*</span> <span class="n">tb_to</span><span class="p">;</span>
<span class="n">vart</span><span class="p">::</span><span class="n">TensorBuffer</span><span class="p">::</span><span class="n">copy_tensor_buffer</span><span class="p">(</span><span class="n">tb_from</span><span class="o">.</span><span class="n">get</span><span class="p">(),</span> <span class="n">tb_to</span><span class="o">.</span><span class="n">get</span><span class="p">());</span>
</pre></div>
</div>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>tb_from</strong> – the source <a class="reference internal" href="../namespace/namespacevart.html#classvart_1_1_tensor_buffer"><span class="std std-ref">TensorBuffer</span></a>. </p></li>
<li><p><strong>tb_to</strong> – the destination <a class="reference internal" href="../namespace/namespacevart.html#classvart_1_1_tensor_buffer"><span class="std std-ref">TensorBuffer</span></a>. </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>void</p>
</dd>
</dl>
</dd></dl>

<dl class="cpp function">
<dt class="sig sig-object cpp" id="_CPPv4N4vart15TensorBufferExt35create_unowned_device_tensor_bufferEPKN3xir6TensorEA_8uint64_t6size_t">
<span id="_CPPv3N4vart15TensorBufferExt35create_unowned_device_tensor_bufferEPKN3xir6TensorEA_8uint64_t6size_t"></span><span id="_CPPv2N4vart15TensorBufferExt35create_unowned_device_tensor_bufferEPKN3xir6TensorEA_8uint64_t6size_t"></span><span id="vart::TensorBufferExt::create_unowned_device_tensor_buffer__xir::TensorCP.uint64_tA.s"></span><span class="target" id="classvart_1_1_tensor_buffer_1a945c798b96ee1f351e7474db08bb379a"></span><span class="k"><span class="pre">static</span></span><span class="w"> </span><span class="n"><span class="pre">std</span></span><span class="p"><span class="pre">::</span></span><span class="n"><span class="pre">unique_ptr</span></span><span class="p"><span class="pre">&lt;</span></span><a class="reference internal" href="classvart_1_1_tensor_buffer.html#_CPPv4N4vart12TensorBufferE" title="vart::TensorBuffer"><span class="n"><span class="pre">TensorBuffer</span></span></a><span class="p"><span class="pre">&gt;</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">create_unowned_device_tensor_buffer</span></span></span><span class="sig-paren">(</span><span class="k"><span class="pre">const</span></span><span class="w"> </span><a class="reference internal" href="../file/runner_8hpp.html#_CPPv43xir" title="xir"><span class="n"><span class="pre">xir</span></span></a><span class="p"><span class="pre">::</span></span><span class="n"><span class="pre">Tensor</span></span><span class="w"> </span><span class="p"><span class="pre">*</span></span><span class="n sig-param"><span class="pre">tensor</span></span>, <span class="n"><span class="pre">uint64_t</span></span><span class="w"> </span><span class="n sig-param"><span class="pre">batch_addr</span></span><span class="p"><span class="pre">[</span></span><span class="p"><span class="pre">]</span></span>, <span class="n"><span class="pre">size_t</span></span><span class="w"> </span><span class="n sig-param"><span class="pre">addr_arrsize</span></span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv4N4vart15TensorBufferExt35create_unowned_device_tensor_bufferEPKN3xir6TensorEA_8uint64_t6size_t" title="Permalink to this definition">¶</a><br /></dt>
<dd><p>create unowned device tensor buffer with device physical addresses for a tensor. </p>
<p>There are some limitations on the arguments:<ol class="lowerroman simple">
<li><p>The addr_arrsize must NOT be greater than the tensor batch.</p></li>
<li><p>The tensor must have attribute ddr_addr whose value must be 0.</p></li>
</ol>
</p>
<p>
Sample code:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">auto</span> <span class="n">runner</span> <span class="o">=</span> <span class="n">vart</span><span class="p">::</span><span class="n">RunnerExt</span><span class="p">::</span><span class="n">create_runner</span><span class="p">(</span><span class="n">subgraph</span><span class="p">,</span> <span class="n">attrs</span><span class="p">);</span>
<span class="n">auto</span> <span class="n">input_tensors</span> <span class="o">=</span> <span class="n">runner</span><span class="o">-&gt;</span><span class="n">get_input_tensors</span><span class="p">();</span>
<span class="n">auto</span> <span class="n">output_tensors</span> <span class="o">=</span> <span class="n">runner</span><span class="o">-&gt;</span><span class="n">get_output_tensors</span><span class="p">();</span>
<span class="n">std</span><span class="p">::</span><span class="n">vector</span><span class="o">&lt;</span><span class="n">vart</span><span class="p">::</span><span class="n">TensorBuffer</span><span class="o">*&gt;</span> <span class="n">input_tensor_buffers</span><span class="p">;</span>
<span class="n">std</span><span class="p">::</span><span class="n">vector</span><span class="o">&lt;</span><span class="n">vart</span><span class="p">::</span><span class="n">TensorBuffer</span><span class="o">*&gt;</span> <span class="n">output_tensor_buffers</span><span class="p">;</span>
<span class="n">uint64_t</span> <span class="n">in_batch_addr</span><span class="p">[</span><span class="mi">1</span><span class="p">];</span>
<span class="n">uint64_t</span> <span class="n">out_batch_addr</span><span class="p">[</span><span class="mi">1</span><span class="p">];</span>
<span class="n">in_batch_addr</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">=</span> <span class="n">DEVICE_PHY_ADDRESS_IN</span><span class="p">;</span>
<span class="n">out_batch_addr</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">=</span> <span class="n">DEVICE_PHY_ADDRESS_OUT</span><span class="p">;</span>
<span class="n">auto</span> <span class="n">input_tb</span> <span class="o">=</span> <span class="n">vart</span><span class="p">::</span><span class="n">TensorBuffer</span><span class="p">::</span><span class="n">create_unowned_device_tensor_buffer</span><span class="p">(</span>
      <span class="n">input_tensors</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="n">in_batch_addr</span><span class="p">,</span> <span class="mi">1</span><span class="p">);</span>
<span class="n">auto</span> <span class="n">output_tb</span> <span class="o">=</span> <span class="n">vart</span><span class="p">::</span><span class="n">TensorBuffer</span><span class="p">::</span><span class="n">create_unowned_device_tensor_buffer</span><span class="p">(</span>
      <span class="n">output_tensors</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="n">out_batch_addr</span><span class="p">,</span> <span class="mi">1</span><span class="p">);</span>
<span class="n">input_tensor_buffers</span><span class="o">.</span><span class="n">emplace_back</span><span class="p">(</span><span class="n">input_tb</span><span class="o">.</span><span class="n">get</span><span class="p">());</span>
<span class="n">output_tensor_buffers</span><span class="o">.</span><span class="n">emplace_back</span><span class="p">(</span><span class="n">output_tb</span><span class="o">.</span><span class="n">get</span><span class="p">());</span>
<span class="n">auto</span> <span class="n">v</span> <span class="o">=</span> <span class="n">runner</span><span class="o">-&gt;</span><span class="n">execute_async</span><span class="p">(</span><span class="n">input_tensor_buffers</span><span class="p">,</span> <span class="n">output_tensor_buffers</span><span class="p">);</span>
</pre></div>
</div>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>tensor</strong> – XIR tensor pointer </p></li>
<li><p><strong>batch_addr</strong> – Array which contains device physical address for each batch </p></li>
<li><p><strong>addr_arrsize</strong> – The array size of batch_addr </p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
<dd class="field-even"><p>Unique pointer of created tensor buffer.</p>
</dd>
</dl>
</dd></dl>

</div>
</dd></dl>

</section>


           </div>
          </div>
          
				  
				  <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
        <a href="classvart_1_1_tensor_buffer.html" class="btn btn-neutral float-left" title="Class vart::TensorBuffer" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
        <a href="../pythonlist.html" class="btn btn-neutral float-right" title="Python APIs" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
    </div>

  <hr/>

  <div role="contentinfo">
    <p>&#169; Copyright 2022-2023, Advanced Micro Devices, Inc.
      <span class="lastupdated">Last updated on July 19, 2023.
      </span></p>
  </div>



										<div class="aem-Grid aem-Grid--16">
											<div class="aem-GridColumn aem-GridColumn--xxxlarge--none aem-GridColumn--xsmall--16 aem-GridColumn--offset--xsmall--0 aem-GridColumn--xlarge--none aem-GridColumn--xxlarge--none aem-GridColumn--default--none aem-GridColumn--offset--large--1 aem-GridColumn--xlarge--12 aem-GridColumn--offset--default--0 aem-GridColumn--xxlarge--10 aem-GridColumn--offset--xlarge--2 aem-GridColumn--offset--xxlarge--3 aem-GridColumn--offset--xxxlarge--4 aem-GridColumn--xsmall--none aem-GridColumn--large--none aem-GridColumn aem-GridColumn--large--14 aem-GridColumn--xxxlarge--8 aem-GridColumn--default--16">
												<div class="container-fluid sub-footer">

													                    <div class="row">
                        <div class="col-xs-24">
                          <p><a target="_blank" href="https://www.amd.com/en/corporate/copyright">Terms and Conditions</a> | <a target="_blank" href="https://www.amd.com/en/corporate/privacy">Privacy</a> | <a target="_blank" href="https://www.amd.com/en/corporate/cookies">Cookie Policy</a> | <a target="_blank" href="https://www.amd.com/en/corporate/trademarks">Trademarks</a> | <a target="_blank" href="https://www.amd.com/system/files/documents/statement-human-trafficking-forced-labor.pdf">Statement on Forced Labor</a> | <a target="_blank" href="https://www.amd.com/en/corporate/competition">Fair and Open Competition</a> | <a target="_blank" href="https://www.amd.com/system/files/documents/amd-uk-tax-strategy.pdf">UK Tax Strategy</a> | <a target="_blank" href="https://docs.xilinx.com/v/u/9x6YvZKuWyhJId7y7RQQKA">Inclusive Terminology</a> | <a href="#cookiessettings" class="ot-sdk-show-settings">Cookies Settings</a></p>
                        </div>
                    </div>
												</div>
											</div>
										</div>
										
</br>


  Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
    <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
    provided by <a href="https://readthedocs.org">Read the Docs</a>.
   

</footer>
        </div>
      </div>
    </section>
  </div>
  <script>
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script>
 <script type="text/javascript">
    $(document).ready(function() {
        $(".toggle > *").hide();
        $(".toggle .header").show();
        $(".toggle .header").click(function() {
            $(this).parent().children().not(".header").toggle(400);
            $(this).parent().children(".header").toggleClass("open");
        })
    });
</script>


</body>
</html>